home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
amitcp_ups10.lha
/
ups-sendmail.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-10
|
735b
|
42 lines
/*
* Replace this with your own version or a real sendmail if
* available
*
* This program will be called as \'ups-sendmail <parameters>\'
* and it will get the mail from stdin.
*/
#include <stdio.h>
#include <stdlib.h>
#ifndef BUFSIZ
#define BUFSIZ 256
#endif
int main(int argc, char *argv[])
{
char buf[BUFSIZ];
FILE *out;
int l;
if(argc < 2)
exit(1);
out = fopen("con:10/10/600/200/UPS-Sendmail/AUTO/WAIT/CLOSE/INACTIVE", "w");
if(!out)
exit(1);
fprintf(out, "Mail arrived (");
for(l=1; l<argc; l++)
fprintf(out, "%s ", argv[l]);
fprintf(out,")\n\n");
while(l = fread(buf, sizeof(char), BUFSIZ, stdin))
{
fwrite(buf, sizeof(char), l, out);
}
fclose(out);
}